/*
 * @作者: 沙昊
 * @邮箱: shahao@zju.edu.cn
 * @功能: 
 * @包含算法: 
 * Copyright (c) 2023 by 沙昊, All Rights Reserved. 
 */
#include <iostream>
#include <cmath>
#include <vector>
using namespace std;

int main() {
    int n,m;
    cin>> n>>m;
    vector<long long> sha_owes(m,0);

    for(int i=0; i<n; ++i){
        int k,c;
        cin >> k>>c;

        int sha_amount = ceil((double)c /k );

        for(int j=0; j<k-1; ++j){
            int person;
            cin>> person;
            sha_owes[person -1] += sha_amount;

        }

    }

    for(int i=0; i<m; ++i){
        cout<< sha_owes[i] <<" ";
    }
    return 0;

}
// 64 位输出请用 printf("%lld")